﻿<UserControl x:Class="Views.ViewResCRT"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Actuariat="clr-namespace:Actuariat;assembly=Actuariat"
             xmlns:Theme="clr-namespace:OMANE.Common.UI.Theme;assembly=OMANE.Common.UI.Theme"
             xmlns:ig="clr-namespace:Infragistics.Windows.Editors;assembly=InfragisticsWPF4.Editors.v10.3"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="10"></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition Height="5"></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition Height="5"></RowDefinition>
                <RowDefinition></RowDefinition>
                <RowDefinition Height="10"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="10"></ColumnDefinition>
                <ColumnDefinition Width="1.8*"></ColumnDefinition>
                <ColumnDefinition Width="1.25*"></ColumnDefinition>
                <ColumnDefinition Width="5"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="5"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="5"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="10"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center">Nombre d'années de projection </TextBlock>
            <TextBlock x:Name="NumNbAnneesProj" Grid.Row="1" Grid.Column="2" Width="Auto" Margin="0" Text="{Binding NombreAnneesProjection}" VerticalAlignment="Center" />
            <TextBlock Grid.Row="3" Grid.Column="1" VerticalAlignment="Center">Année de la première génération </TextBlock>
            <Theme:NumericEditor x:Name="NumAnnee1gen" 
                                 Grid.Row="3" 
                                 Grid.Column="2" 
                                 Width="Auto" 
                                 Style="{DynamicResource NumberEditor}" 
                                 Margin="0" 
                                 Value="{Binding ComptesMoteur2.AnneePremiereGeneration}" 
                                 VerticalAlignment="Center">
                    <Theme:NumericEditor.ValueConstraint>
                        <ig:ValueConstraint MaxInclusive="2100" MinInclusive="1990" Nullable="False" ValidateAsType="Integer32"/>
                    </Theme:NumericEditor.ValueConstraint>
             </Theme:NumericEditor>
            <TextBlock Grid.Row="1" Grid.Column="4" VerticalAlignment="Center">PM de rente</TextBlock>
            <ComboBox Grid.Row="1" Grid.Column="5" VerticalAlignment="Center" ItemsSource="{Binding ListeBooleanCbx}" SelectedItem="{Binding HasPMRente}"></ComboBox>
            <TextBlock Grid.Row="3" Grid.Column="4" VerticalAlignment="Center">N° Segment</TextBlock>
            <ComboBox Grid.Row="3" Grid.Column="5" VerticalAlignment="Center" ItemsSource="{Binding ListeIdSegments}" SelectedItem="{Binding SelectedIdSegment}"></ComboBox>
            <TextBlock Grid.Row="1" Grid.Column="7" VerticalAlignment="Center">PPRC</TextBlock>
            <ComboBox Grid.Row="1" Grid.Column="8" VerticalAlignment="Center" ItemsSource="{Binding ListeBooleanCbx}" SelectedItem="{Binding HasPPRC}"></ComboBox>
            <TextBlock Grid.Row="3" Grid.Column="7" VerticalAlignment="Center">N° génération</TextBlock>
            <ComboBox Grid.Row="3" Grid.Column="8" VerticalAlignment="Center" ItemsSource="{Binding ListeIdGenerations}" SelectedItem="{Binding SelectedIdGeneration}"></ComboBox>
            <TextBlock Grid.Row="1" Grid.Column="10" VerticalAlignment="Center">PM décès</TextBlock>
            <ComboBox Grid.Row="1" Grid.Column="11" VerticalAlignment="Center" ItemsSource="{Binding ListeBooleanCbx}" SelectedItem="{Binding HasPMdc}"></ComboBox>
            <TextBlock Grid.Row="3" Grid.Column="10" VerticalAlignment="Center">Unité</TextBlock>
            <ComboBox Grid.Row="3" Grid.Column="11" VerticalAlignment="Center" ItemsSource="{Binding ListeUnites}" SelectedItem="{Binding SelectedUnite}"></ComboBox>
            <TextBlock Grid.Row="5" Grid.Column="1" VerticalAlignment="Center">Compte</TextBlock>
            <ComboBox Grid.Row="5" Grid.Column="2" x:Name="cbxCompte" VerticalAlignment="Center" ItemsSource="{Binding ListeGrillesComptes}" SelectedItem="{Binding SelectedCompte}"></ComboBox>
            <TextBlock Grid.Row="5" Grid.Column="4" VerticalAlignment="Center">TRI</TextBlock>
            <TextBlock Grid.Row="5" Grid.Column="5" VerticalAlignment="Center" Foreground="Red" Text="{Binding TRI,  StringFormat=\{0:P\}}" xml:lang="fr-FR"></TextBlock>            
            <TextBlock Grid.Row="5" Grid.Column="7" VerticalAlignment="Center">VAN</TextBlock>
            <TextBlock Grid.Row="5" Grid.Column="8" VerticalAlignment="Center" Foreground="Red" Text="{Binding VANoperation, StringFormat=\{0:N\}}" xml:lang="fr-FR"></TextBlock>
            <TextBlock Grid.Row="5" Grid.Column="10" VerticalAlignment="Center">VAN des primes</TextBlock>
            <TextBlock Grid.Row="5" Grid.Column="11" VerticalAlignment="Center" Foreground="Red" Text="{Binding VANprimes, StringFormat=\{0:N\}}" xml:lang="fr-FR"></TextBlock>
        </Grid>
        <Actuariat:GrilleComptes x:Name="GrilleCompte"
                                 DataContext="{Binding SelectedItem, ElementName=cbxCompte,Mode=TwoWay}"
                                 Grid.Row="1"
                                 Margin="10,5,10,10">
            <!--<Actuariat:GrilleComptes.NombreAnneesProjection>
                10
            </Actuariat:GrilleComptes.NombreAnneesProjection>-->
        </Actuariat:GrilleComptes>        
    </Grid>
</UserControl>
